import { request } from '@/shared/axios';
import { getUserAuth } from '@/utils/login';

/**
 * 获取用户信息
 * @param {string} community 社区名
 * @returns {Promise<ResponseT> } 用户信息
 */
export function getUserInfo(community: string) {
  const token = getUserAuth();
  const url = `/api-omapi/oneid/personal/center/user?community=${community}`;
  return request
    .get(url, {
      headers: {
        token,
      },
    })
    .then((res) => {
      return res.data;
    });
}
